The code here will define our global variables, the #define values we are using, and the global variables. To improve the readability of the code, consider if a global should actually be part of the Settings module before adding it here.
Code
//Includes#include <p18f452.h>//Defines#define GRAMS 0#define OUNCES 1#define I_BUFSIZE 64#define O_BUFSIZE 128#define VBUFSIZE 24#define X Y//Global Variableschar recvbuf[I_BUFSIZE];//All received commands are saved here (both serial and keypress), to be processed laterchar transbuf[O_BUFSIZE];//Output to the serial port is buffered here for the serial_transmit() to sendchar dispbuf[O_BUFSIZE];//Output to the LCD screen is buffered here for the LCD to displaychar saybuf[O_BUFSIZE];//Output to the speech module is buffered here for the speech moduleunsignedint ADSamples[VBUFSIZE];//Buffer of the N most recent voltage samples (in millivolts)//Prototypesvoid initialiseADConverter();int getADValue();
Headers, Defines and Globals
Owner: EveryonePurpose and Documentation
The code here will define our global variables, the #define values we are using, and the global variables. To improve the readability of the code, consider if a global should actually be part of the Settings module before adding it here.Code